package thread;
public class threadDeom3 {
    public static void main(String[] args) {
        Thread t=new Thread(){
            public void run(){
                while (true){
                    System.out.println("这是thread线程");
                    try {
                        Thread.sleep(1000);
                    }catch (InterruptedException e){
                        throw new RuntimeException();
                    }
                }
            }
        };
        t.start();
        while (true){
            System.out.println("这是main线程");
            try {
                Thread.sleep(1000);
            }catch (InterruptedException e){
                throw new RuntimeException();
            }
        }
    }
}

